home *** CD-ROM | disk | FTP | other *** search
/ Java 1996 August / Java - Summer 1996.iso / kaffe-0.2 / kaffe / zipfile.h < prev   
C/C++ Source or Header  |  1996-02-11  |  886b  |  37 lines

  1. /* Definitions for using a zipped' archive.
  2.  
  3. Copyright (c) 1996 Cygnus Support
  4.  
  5. See the file "license.terms" for information on usage and redistribution
  6. of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  7.  
  8. Written by Per Bothner <bothner@cygnus.com>, February 1996.
  9. */
  10.  
  11. struct ZipFile {
  12.   int fd;
  13.   long size;
  14.   long count;
  15.   long dir_size;
  16.   char *central_directory;
  17. };
  18.  
  19. typedef struct ZipFile ZipFile;
  20.  
  21. struct ZipDirectory {
  22.   int direntry_size;
  23.   int filename_offset;
  24.   long size; /* length of file */
  25.   long filestart;  /* start of file in archive */
  26.   long filename_length;
  27.   /* char mid_padding[...]; */
  28.   /* char filename[filename_length]; */
  29.   /* char end_padding[...]; */
  30. };
  31.  
  32. typedef struct ZipDirectory ZipDirectory;
  33.  
  34. #define ZIPDIR_FILENAME(ZIPD) ((char*)(ZIPD)+(ZIPD)->filename_offset)
  35. #define ZIPDIR_NEXT(ZIPD) \
  36.    ((ZipDirectory*)((char*)(ZIPD)+(ZIPD)->direntry_size))
  37.